<template>
	<text class="price avanti" :class="{noPrefix:!showPrefix}">{{intPrice}}<text class="point" v-if="dotPrice">.{{dotPrice}}</text></text>
</template>

<script>
	export default {
		name: 'price',
		data() {
			return {
				
			};
		},
		computed: {
			
			intPrice:function(e){
				if(typeof this.price == "undefined"){
					return "" ;
				}
				return parseInt(this.price);
			},
			
			dotPrice:function(e){
				if(typeof this.price == "undefined"){
					return "" ;
				}
				var dotPrice = this.price%1 ;
				if(dotPrice == 0) return "" ;
				dotPrice = parseInt(dotPrice.toFixed(2)*100)/100 ;
				return dotPrice == 0 ? "" : dotPrice.toString().replace("0.","") ;
			}
			
		},
		props: {
			price: {
				type: [Number,String],
				default: 0.00
			},
			showPrefix:{
				default : true 
			}
		},
		methods: {
			
		}
	}
</script>

<style>

</style>
